package com.webflux.sample.webfluxapp.gen;

import java.io.Serializable;

import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import org.hibernate.annotations.GenericGenerator;

@MappedSuperclass
public abstract class IdEntity implements Serializable {
    /**
     * 全局唯一ID，由 SnowflakeIdGenerator 自动生成
     */
    @Id
    @GenericGenerator(name = "snowflake-id", strategy = "com.webflux.sample.webfluxapp.gen.IdGenerator")
    @GeneratedValue(generator = "snowflake-id")
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}